package ch.fhnw.qualiscan.application.elements;

import ch.fhnw.qualiscan.core.helpers.TextHelper;

import com.vaadin.ui.CssLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;

import eu.livotov.tpt.i18n.TM;

@SuppressWarnings("serial")
public class AnswersLegendBox extends VerticalLayout {

	public AnswersLegendBox() {
		TextHelper textHelper = new TextHelper();
		
		setSpacing(true);
		setMargin(false, false, false, true);
		setStyleName("grey");
		
		// title
		addComponent(textHelper.bigSpan(TM.get("evaluation.legend")));
		
		VerticalLayout legendItems = new VerticalLayout();
		
		// box 1
		HorizontalLayout answer1 = new HorizontalLayout();
		answer1.setSpacing(true);
		CssLayout box1 = new CssLayout();
		box1.setStyleName("answer1 legendBox");
		box1.setHeight("15px");
		box1.setWidth("15px");
		
		answer1.addComponent(box1);
		answer1.addComponent(textHelper.p(TM.get("answer.1")));
		
		legendItems.addComponent(answer1);
		
		// box 2
		HorizontalLayout answer2 = new HorizontalLayout();
		answer2.setSpacing(true);
		CssLayout box2 = new CssLayout();
		box2.setStyleName("answer2 legendBox");
		box2.setHeight("15px");
		box2.setWidth("15px");
		
		answer2.addComponent(box2);
		answer2.addComponent(textHelper.p(TM.get("answer.2")));
		
		legendItems.addComponent(answer2);
		
		// box 3
		HorizontalLayout answer3 = new HorizontalLayout();
		answer3.setSpacing(true);
		CssLayout box3 = new CssLayout();
		box3.setStyleName("answer3 legendBox");
		box3.setHeight("15px");
		box3.setWidth("15px");
		
		answer3.addComponent(box3);
		answer3.addComponent(textHelper.p(TM.get("answer.3")));
		
		legendItems.addComponent(answer3);
		
		// box 4
		HorizontalLayout answer4 = new HorizontalLayout();
		answer4.setSpacing(true);
		CssLayout box4 = new CssLayout();
		box4.setStyleName("answer4 legendBox");
		box4.setHeight("15px");
		box4.setWidth("15px");
		
		answer4.addComponent(box4);
		answer4.addComponent(textHelper.p(TM.get("answer.4")));
		
		legendItems.addComponent(answer4);
		
		// box 5
		HorizontalLayout answer5 = new HorizontalLayout();
		answer5.setSpacing(true);
		CssLayout box5 = new CssLayout();
		box5.setStyleName("answer5 legendBox");
		box5.setHeight("15px");
		box5.setWidth("15px");
		
		answer5.addComponent(box5);
		answer5.addComponent(textHelper.p(TM.get("answer.5")));
		
		legendItems.addComponent(answer5);
		
		addComponent(legendItems);
	}
}
